<?php
/*
Description: This file is used to change login paassword.
*/
#########IncludeFiles####################################################################################
include_once '../inc/config.php';
include_once("../inc/bootstrape.php");
require_once _SITE_PATH_.'classes/Vendor/Vendor.php';
require_once _SITE_PATH_.'classes/Honeymoon/Honeymoon.php';
require_once _SITE_PATH_.'classes/CommonUtility/CommonUtility.php';

//    CHANGE PASSWORD    CODE    //           
if( $_POST['submit']=='Submit')
{    
    $parms['vendor_id'] = $_POST['vendor'];
    $parms['title'] = $_POST['title'];
    $parms['theme_id'] = $_POST['theme'];
    $parms['package_url'] = $_POST['package_url'];
    $parms['days'] = $_POST['days'];
    $parms['tags'] = $_POST['tags'];
    $parms['price_per_couple'] = $_POST['price'];
    $parms['short_description'] = $_POST['short_desc'];
    $parms['description'] = $_POST['description'];
	if(!empty($_POST['destinations'])){
		$parms['destinations'] = @implode(',',$_POST['destinations']);
	}
    $parms['package_type'] = $_POST['package'];
    $parms['cancellation_policy'] = $_POST['policy'];
    $parms['booking_amount'] = $_POST['booking_amt'];
    
    // upload and create thumb of the image //
    if( !empty( $_FILES['package_image'] ) ){
        $filename  = 'package_image';     //  this is name of the control you are using in html form         
        $uploadedfile = CommonUtility::uploadNcreateThumb($filename, $module='wedpkg', true, 100);
        if( $uploadedfile!= -1 )    {
            $parms['image'] = $uploadedfile;//$_POST['package_image'];
        }        
    }
    
    
    if( CommonUtility::insertData($parms, 'honeymoon_package')) {        
        header("Location: package_mng.php?msg=1004");            
        exit;
    }
    $err = 1005;    
}
$dropdown_cities = array();
$dropdown_cities = CommonUtility::getCity('', $_POST['destinations']);
    
//    END CHANGE PASSWORD CODE    //
$errMsg = $err;
$_tplName = 'honeymoon-package/package_add.tpl';
$_title = 'Add Honeymoon Package';
require_once _ADMIN_TPL_MAIN_;
?>